package com.xxx.delayjob.util;

import cn.hutool.core.lang.UUID;
import cn.hutool.core.lang.Validator;

/**
 * hutool小工具类
 */
public class HutoolUtil {
	
	/**
	 * 判断手机号是否合法
	 */
	public static boolean isMobile(String mobile) {
		return Validator.isMobile(mobile);
	}
	
	/**
	 * 判断邮箱是否合法
	 */
	public static boolean isEmail(String email) {
		return Validator.isEmail(email);
	}
	
	/**
	 * 判断生日是否合法
	 */
	public static boolean isBirthday(String birthday) {
		return Validator.isBirthday(birthday);
	}

	public static String uuid(){
		return UUID.fastUUID().toString();
	}
	
	public static void main(String[] args) {
		System.out.println("校验手机号合法性：");
		System.out.println(isMobile("18600012641"));
		System.out.println(isMobile("12600014042"));

		System.out.println("校验邮箱合法性：");
		System.out.println(isEmail("guwq@58.com"));
		System.out.println(isEmail("guweiqiang@.com"));

		System.out.println("校验生日合法性：");
		System.out.println(isBirthday("2020.1.11"));
		System.out.println(isBirthday("2020.09-10"));
		
		
	}

}
